package cn.easybuy.service.news;

import java.sql.Connection;
import java.util.List;

import cn.easybuy.dao.NewsDao;
import cn.easybuy.dao.impl.NewsDaoImpl;
import cn.easybuy.entity.News;
import cn.easybuy.utils.DataSourceUtil;


public class NewsServiceImpl implements NewsService {

	@Override
	public List<News> findAllNews() {
		NewsDao newsDao = new NewsDaoImpl(DataSourceUtil.getConnection());
		return newsDao.findAllNews();
	}

	@Override
	public List<News> getPageList(int pageNo, int pageSize) {
		NewsDao newsDao = new NewsDaoImpl(DataSourceUtil.getConnection());
		return newsDao.getPageList(pageNo, pageSize);
	}

	@Override
	public int getCount() {
		NewsDao newsDao = new NewsDaoImpl(DataSourceUtil.getConnection());
		return newsDao.getCount();
	}
}
